home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / WaveTableOscControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  3.9 KB  |  111 lines  |  [TEXT/KAHL]

  1. /* WaveTableOscControl.h */
  2.  
  3. #ifndef Included_WaveTableOscControl_h
  4. #define Included_WaveTableOscControl_h
  5.  
  6. /* WaveTableOscControl module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* FastFixedPoint */
  12. /* FixedPoint */
  13. /* Memory */
  14. /* EnvelopeState */
  15. /* SampleConsts */
  16. /* LFOGenerator */
  17. /* Multisampler */
  18. /* OscillatorSpecifier */
  19. /* Envelope */
  20. /* LFOListSpecifier */
  21. /* FastModulation */
  22. /* 64BitMath */
  23. /* ErrorDaemon */
  24.  
  25. #include "FixedPoint.h"
  26. #include "FastFixedPoint.h"
  27. #include "ModulationSpecifier.h"
  28.  
  29. struct WaveTableTemplateRec;
  30. typedef struct WaveTableTemplateRec WaveTableTemplateRec;
  31.  
  32. struct WaveTableStateRec;
  33. typedef struct WaveTableStateRec WaveTableStateRec;
  34.  
  35. /* forwards */
  36. struct OscillatorRec;
  37. struct ArrayRec;
  38. struct ErrorDaemonRec;
  39.  
  40. /* get rid of all cached memory for state or template records */
  41. void                                    FlushWaveTableOscControl(void);
  42.  
  43. /* perform one envelope update cycle */
  44. void                                    UpdateWaveTableEnvelopes(WaveTableStateRec* State);
  45.  
  46. /* dispose of the wave table state record */
  47. void                                    DisposeWaveTableState(WaveTableStateRec* State);
  48.  
  49. /* dispose of the wave table information template */
  50. void                                    DisposeWaveTableTemplate(WaveTableTemplateRec* Template);
  51.  
  52. /* create a new wave table template */
  53. WaveTableTemplateRec*    NewWaveTableTemplate(struct OscillatorRec* Oscillator,
  54.                                                 float EnvelopeTicksPerSecond, long SamplingRate,
  55.                                                 MyBoolean Stereo, MyBoolean TimeInterp, MyBoolean WaveInterp,
  56.                                                 struct ErrorDaemonRec* ErrorDaemon);
  57.  
  58. /* create a new wave table state object. */
  59. WaveTableStateRec*        NewWaveTableState(WaveTableTemplateRec* Template,
  60.                                                 float FreqForMultisampling, float Accent1, float Accent2,
  61.                                                 float Accent3, float Accent4, float Loudness, float HurryUp,
  62.                                                 long* PreOriginTimeOut, float StereoPosition,
  63.                                                 float InitialFrequency);
  64.  
  65. /* fix up pre-origin time for the wave table state object */
  66. void                                    FixUpWaveTableStatePreOrigin(WaveTableStateRec* State,
  67.                                                 long ActualPreOrigin);
  68.  
  69. /* set a new frequency for a wave table state object.  used for portamento */
  70. /* and modulation of frequency (vibrato) */
  71. void                                    WaveTableStateNewFrequency(WaveTableStateRec* State,
  72.                                                 float NewFrequencyHertz);
  73.  
  74. /* send a key-up signal to one of the oscillators */
  75. void                                    WaveTableKeyUpSustain1(WaveTableStateRec* State);
  76. void                                    WaveTableKeyUpSustain2(WaveTableStateRec* State);
  77. void                                    WaveTableKeyUpSustain3(WaveTableStateRec* State);
  78.  
  79. /* restart a wave table oscillator.  this is used for tie continuations */
  80. void                                    RestartWaveTableState(WaveTableStateRec* State,
  81.                                                 float NewFreqMultisampling, float NewAccent1, float NewAccent2,
  82.                                                 float NewAccent3, float NewAccent4, float NewLoudness,
  83.                                                 float NewHurryUp, MyBoolean RetriggerEnvelopes,
  84.                                                 float NewStereoPosition, float NewInitialFrequency);
  85.  
  86. /* generate a sequence of samples (called for each envelope clock) */
  87. void                                    WaveTableGenSamples(WaveTableStateRec* State,
  88.                                                 long SampleCount, largefixedsigned* RawBuffer);
  89.  
  90. /* find out if the wave table oscillator has finished */
  91. MyBoolean                            WaveTableIsItFinished(WaveTableStateRec* State);
  92.  
  93. /* generate a single sample (called for modulation chains) */
  94. /* OutputPlace should have 1 entry for mono output or 2 entries for stereo output */
  95. float                                    WaveTableGenOneSample(WaveTableStateRec* State,
  96.                                                 ModulationTypes* PhaseGenModulateHow,
  97.                                                 float* PhaseGenModulationScaling,
  98.                                                 float* PhaseGenModulationOrigin,
  99.                                                 float* PhaseGenOldValues,
  100.                                                 long* PhaseGenIndirectionTable,
  101.                                                 long NumberOfPhaseGenModulators,
  102.                                                 ModulationTypes* OutputModulateHow,
  103.                                                 float* OutputModulationScaling,
  104.                                                 float* OutputModulationOrigin,
  105.                                                 float* OutputOldValues,
  106.                                                 long* OutputIndirectionTable,
  107.                                                 long NumberOfOutputModulators,
  108.                                                 largefixedsigned* OutputPlace);
  109.  
  110. #endif
  111.